<?php

/**
 * Roditelj form base class.
 *
 * @package    dnevnik
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseRoditeljForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                => new sfWidgetFormInputHidden(),
      'skola_id'          => new sfWidgetFormPropelChoice(array('model' => 'Skola', 'add_empty' => false)),
      'ime_majka'         => new sfWidgetFormInput(),
      'prezime_majka'     => new sfWidgetFormInput(),
      'ime_staratelj'     => new sfWidgetFormInput(),
      'prezime_staratelj' => new sfWidgetFormInput(),
      'mobilni2'          => new sfWidgetFormInput(),
      'clanarina'         => new sfWidgetFormDateTime(),
      'clanarina_tst'     => new sfWidgetFormInput(),
      'clanarina_soc'     => new sfWidgetFormInput(),
      'kredit'            => new sfWidgetFormInput(),
      'oba_telefona'      => new sfWidgetFormInputCheckbox(),
      'ocene'             => new sfWidgetFormInputCheckbox(),
      'izostanci'         => new sfWidgetFormInputCheckbox(),
      'domaci'            => new sfWidgetFormInputCheckbox(),
      'obavestenja'       => new sfWidgetFormInputCheckbox(),
      'otac_pok'          => new sfWidgetFormInputCheckbox(),
      'majka_pok'         => new sfWidgetFormInputCheckbox(),
      'tip'               => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'                => new sfValidatorPropelChoice(array('model' => 'Profil', 'column' => 'id', 'required' => false)),
      'skola_id'          => new sfValidatorPropelChoice(array('model' => 'Skola', 'column' => 'id')),
      'ime_majka'         => new sfValidatorString(array('max_length' => 25, 'required' => false)),
      'prezime_majka'     => new sfValidatorString(array('max_length' => 25, 'required' => false)),
      'ime_staratelj'     => new sfValidatorString(array('max_length' => 25, 'required' => false)),
      'prezime_staratelj' => new sfValidatorString(array('max_length' => 25, 'required' => false)),
      'mobilni2'          => new sfValidatorString(array('max_length' => 15, 'required' => false)),
      'clanarina'         => new sfValidatorDateTime(array('required' => false)),
      'clanarina_tst'     => new sfValidatorInteger(array('required' => false)),
      'clanarina_soc'     => new sfValidatorInteger(array('required' => false)),
      'kredit'            => new sfValidatorNumber(array('required' => false)),
      'oba_telefona'      => new sfValidatorBoolean(array('required' => false)),
      'ocene'             => new sfValidatorBoolean(array('required' => false)),
      'izostanci'         => new sfValidatorBoolean(array('required' => false)),
      'domaci'            => new sfValidatorBoolean(array('required' => false)),
      'obavestenja'       => new sfValidatorBoolean(array('required' => false)),
      'otac_pok'          => new sfValidatorBoolean(array('required' => false)),
      'majka_pok'         => new sfValidatorBoolean(array('required' => false)),
      'tip'               => new sfValidatorInteger(),
    ));

    $this->widgetSchema->setNameFormat('roditelj[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Roditelj';
  }


}
